﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="CommentMovie.aspx.cs" Inherits="CommentMovie" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1" 
        DataKeyNames="MovieID">
        <EditItemTemplate>
            MovieID:
            <asp:Label ID="MovieIDLabel1" runat="server" Text='<%# Eval("MovieID") %>' />
            <br />
            Title:
            <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
            <br />
            Description:
            <asp:TextBox ID="DescriptionTextBox" runat="server" 
                Text='<%# Bind("Description") %>' />
            <br />
            Length:
            <asp:TextBox ID="LengthTextBox" runat="server" Text='<%# Bind("Length") %>' />
            <br />
            Director:
            <asp:TextBox ID="DirectorTextBox" runat="server" 
                Text='<%# Bind("Director") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Aktualisieren" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Abbrechen" />
        </EditItemTemplate>
        <InsertItemTemplate>
            Title:
            <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
            <br />
            Description:
            <asp:TextBox ID="DescriptionTextBox" runat="server" 
                Text='<%# Bind("Description") %>' />
            <br />
            Length:
            <asp:TextBox ID="LengthTextBox" runat="server" Text='<%# Bind("Length") %>' />
            <br />
            Director:
            <asp:TextBox ID="DirectorTextBox" runat="server" 
                Text='<%# Bind("Director") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Einfügen" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Abbrechen" />
        </InsertItemTemplate>
        <ItemTemplate>
            MovieID:
            <asp:Label ID="MovieIDLabel" runat="server" Text='<%# Eval("MovieID") %>' />
            <br />
            Title:
            <asp:Label ID="TitleLabel" runat="server" 
                Text='<%# Bind("Title") %>' />
            <br />
            Description:
            <asp:Label ID="DescriptionLabel" runat="server" 
                Text='<%# Bind("Description") %>' />
            <br />
            Length:
            <asp:Label ID="LengthLabel" runat="server" Text='<%# Bind("Length") %>' />
            <br />

            Director:
            <asp:Label ID="DirectorLabel" runat="server" Text='<%# Bind("Director") %>' />
            <br />

        </ItemTemplate>
    </asp:FormView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        
        SelectCommand="SELECT MovieID, Title, Description, Length, Director FROM Movie WHERE (MovieID = @MovieID)">
        <SelectParameters>
            <asp:QueryStringParameter Name="MovieID" QueryStringField="MovieID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:TextBox ID="txt_comment" runat="server"></asp:TextBox>
    <asp:Button ID="btn_comment" runat="server" Text="Save Comment" 
        onclick="btn_comment_Click" />
</asp:Content>

